﻿namespace Utils
{
    public static class MathMethods
    {
        public static string CalculatePercentage(int part, int total)
        {
            if (total == 0)
            {
                throw new ArgumentException("被除数不能是0");
            }
            return Math.Round((double)part / total * 100, 2, MidpointRounding.AwayFromZero).ToString() + "%";
        }
    }
}
